#ifndef MSCATTERINGLIDARFORM_H
#define MSCATTERINGLIDARFORM_H

#include <QWidget>
#include <QMutex>


#include "lidarclient.h"

namespace Ui {
class MScatteringLidarForm;
}

class MScatteringLidarForm : public QWidget
{
    Q_OBJECT

public:
    explicit MScatteringLidarForm(QWidget *parent = nullptr);
    ~MScatteringLidarForm();

public slots:
    //lidarClient调用GetPMTState后，对返回值进行处理的槽函数
    void Slot_resGetPMTState(const QSharedPointer<lidar::RuntimeParamsPackage>);
    //lidarClient调用StartAcquire后，对返回值进行处理的槽函数
    void Slot_resStartAcquire(const QSharedPointer<lidar::XError>);
    //lidarClient调用GetNextComputeData后，对返回值进行处理的槽函数
    void Slot_resGetNextComputeData(const QSharedPointer<lidar::ComputedResult>);
    //lidarClient调用GetNextData后，对返回值进行处理的槽函数
    void Slot_resGetNextData(const QSharedPointer<lidar::LidarRawData> );


private:
    Ui::MScatteringLidarForm *ui;
    QSharedPointer<LidarClient> m_client;
    std::shared_ptr<grpc::Channel> m_channel;
    void formInit();
    QMutex m_mutex;
    lidar::GUID m_guid;

    //以下为测试函数
    void test_computer();
    void test_getNextComputerData();
    void test_setLaser();
    void test_beginQueryData();
    void test_getNextData();
    void test_moveToAngle();
signals:
    void Sig_sendLidarClient(QSharedPointer<LidarClient>);
};

#endif // MSCATTERINGLIDARFORM_H
